/* eslint-disable import/no-anonymous-default-export */
import { finance } from '../services/financeApi'

export default {
    state: {
        data: []
    },
    effects: {
        async finance(params) {
            const response = await finance(params)
            if (response.code === 200) {

                this.saveFinance({
                    data: response.data
                })
            }
        }
    },
    reducers: {
        saveFinance(state, paylode) {
            return {
                ...state,
                ...paylode
            }
        }
    }
}